{% extends 'base.html' %}

{% block title %}Nieuws{% endblock title %}

{% block user_menu %}

	{% if is_groep %}
		<li><a href="{{ BASE_PATH }}news/home/{{ game_id }}">Nieuws</a></li>
		<li><a href="{{ BASE_PATH }}round/home/{{ game_id }}">Resultaten</a></li>
		<li><a href="{{ BASE_PATH }}round/home/{{ game_id }}">Overzicht</a></li>
		<li><a href="{{ BASE_PATH }}round/edit/{{ game_id }}">Beslissingen</a></li>
	{% endif %}

<li><a href="{{ BASE_PATH }}logout">Uitloggen?</a></li>
{% endblock user_menu %}

{% block body%}
	<div class="post">
		<div class="post-bgtop">
			<div class="post-bgbtm">
				<h1 class="title"> Nieuws over {{ game.name }}</h1>
				<div class="entry">
					<table>
						{% if game.storm %}
						<tr>
							<td>Storm op komst:</td>
							<td>Volgens Jan Jansma is er storm op komst</td>
						</tr>
						{% endif %}
					</table>
				</div>
			</div>
		</div>
	</div>
	{% for contract in acceptedContracts %}
	<div class="post">
		<div class="post-bgtop">
			<div class="post-bgbtm">
				<h1 class="title">Geaccepteerde contracten</h1>
				<div class="entry">
					<table>
						<tr>
							<td>Geaccepteerd contract: </td>
							<td>
								<table>
									<tr>
										<td>Aantal inwoners:</td>
										<td>{{ contract.noOfCitizens }}</td>
										<td></td>
									</tr>
									<tr>
										<td>Verbruik:</td>
										<td>{{ contract.usage }}</td>
										<td>in MW</td>
									</tr>
									<tr>
										<td>Bedrag:</td>
										<td>{{ contract.finalOffer }}</td>
										<td>euro per MWh</td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</div>
			</div>
		</div>
	</div>						
	{% endfor %}
	{% if releasedContracts %}
		{% for contract in releasedContracts %}
		<div class="post">
			<div class="post-bgtop">
				<div class="post-bgbtm">
					<h1 class="title">Vrijgekomen contracten</h1>
					<div class="entry">
						<table>
							<tr>
								<td>Vrijgekomen contract: </td>
								<td>
									<table>
										<tr>
											<td>Aantal inwoners:</td>
											<td>{{ contract.noOfCitizens }}</td>
											<td></td>
										</tr>
										<tr>
											<td>Verbruik:</td>
											<td>{{ contract.usage }}</td>
											<td>in MW</td>
										</tr>
										<tr>
											<td>Bedrag:</td>
											<td>{{ contract.price }}</td>
											<td>euro per MWh</td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<td><a href="{{ BASE_PATH }}contract/bid/released/{{ contract.id }}">Bieden?</a></td>
								<td></td>
							</tr>
						</table>
					</div>
				</div>
			</div>
		</div>						
		{% endfor %}
	{% endif %}
	{% if volatileContracts %}
		{% for contract in volatileContracts %}
		<div class="post">
			<div class="post-bgtop">
				<div class="post-bgbtm">
					<h1 class="title">Vrijgekomen contracten, reeds geboden</h1>
					<div class="entry">
						<table>
							<tr>
								<td>Vrijgekomen contract: </td>
								<td>
									<table>
										<tr>
											<td>Aantal inwoners:</td>
											<td>{{ contract.noOfCitizens }}</td>
											<td></td>
										</tr>
										<tr>
											<td>Verbruik:</td>
											<td>{{ contract.usage }}</td>
											<td>in MW</td>
										</tr>
										<tr>
											<td>Bedrag:</td>
											<td>{{ contract.price }}</td>
											<td>euro per MWh</td>
										</tr>
										<tr>
											<td>Bod:</td>
											<td>{{ contract.bid }}</td>
											<td></td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<td><a href="{{ BASE_PATH }}contract/bid/volatile/{{ contract.id }}">Bieden?</a></td>
								<td></td>
							</tr>
						</table>
					</div>
				</div>
			</div>
		</div>						
		{% endfor %}
	{% endif %}

{% endblock body %}
